home *** CD-ROM | disk | FTP | other *** search
- Short: Flexible Text PLUGIN
- Type: dev/e
- Author: jason@fsel.com (Jason R. Hulance)
-
- text_plug.m defines a new text PLUGIN for use with EasyGUI. It has
- several advantages over a normal TEXT gadget:
-
- 1) It only renders within its allocated space, even if you change the
- text. (If you change the text of a normal TEXT gadget to a long
- string then it will overwrite the window border.)
- 2) You can specify the fonts to use for the label and the main string.
- 3) In conjunction with the supplied fonts.m module, you can easily
- use the user's preferred default font (fixed width) or screen font
- (usually proportional).
- 4) If you resize the GUI, more/less of the string will be shown, as
- possible.
-
- An example program is supplied which uses an ASL requester for you to
- select a font. The use's preferred default font and screen font are
- also used in the example.
-
- Sources are included!
-
- Usage
- -----
- The constructor is:
-
- PROC create(str, label=NIL, min=0, sfont=NIL:PTR TO textfont,
- lfont=NIL:PTR TO textfont)
-
- o 'str' The main string to be displayed. The remaining arguments
- are optional.
- o 'label' A (fixed) label to be displayed before the string.
- o 'min' The minimum number of characters of the string that will
- be displayed after any resize of the GUI. If it is zero
- (the default) then this minimum width will be sufficient
- to always display the whole of the initial 'str'. (The
- label will always get to be displayed.)
- o 'sfont' The font to be used for the main string. The default is
- to use the user's preferred default font (which is fixed
- width) via the deffixedfont variable (see below).
- o 'lfont' The font to be used for the label. The default is to use
- the user's preferred screen font (which is the default
- font for EasyGUI) via the deffont variable (see below).
-
- Once you've created a text_plug and added to your EasyGUI you can
- change the string that is being displayed (but you can't change the
- label).
-
- PROC settext(gh:PTR TO guihandle, str)
-
- This is very similar to the EasyGUI settext() function, and so needs
- no further explanation.
-
- If you choose to use the default fonts then create() will raise the
- exception "DFNT" if one of the required default fonts is not
- available.
-
- Preferred Fonts
- ---------------
- The module fonts.m defines two global variables, deffont and
- deffixedfont, and two functions to allocate and deallocate these
- resources:
-
- PROC getdeffonts()
-
- PROC freedeffonts()
-
- If you are going to make use of the default fonts in text_plug then
- you need to call getdeffonts() first, and call freedeffonts() after
- you've finished using the GUI. See the example program...
-
- getdeffonts() will raise the exceptions "FONT" or "PUBS" if an error
- occurs and the fonts could not be allocated.
-